progressbar: Remove useless if statement
authorTimm Bäder <mail@baedert.org>
Mon, 20 Mar 2017 08:22:13 +0000 (09:22 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Mon, 20 Mar 2017 20:45:11 +0000 (20:45 +0000)
Both the if and the else block contained exactly the same code.

gtk/gtkprogressbar.c

index 0ea66927d0f60dd35950c676276749b30185d50b..8f1301dbcce4a887da28c8ec81fd3acc31d727e2 100644 (file)
@@ -1260,12 +1260,10 @@ gtk_progress_bar_act_mode_enter (GtkProgressBar *pbar)
 {
   GtkProgressBarPrivate *priv = pbar->priv;
   GtkWidget *widget = GTK_WIDGET (pbar);
-  GtkOrientation orientation;
   gboolean inverted;
 
   gtk_css_gadget_add_class (priv->progress_gadget, GTK_STYLE_CLASS_PULSE);
 
-  orientation = priv->orientation;
   inverted = priv->inverted;
   if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
     {
@@ -1274,32 +1272,15 @@ gtk_progress_bar_act_mode_enter (GtkProgressBar *pbar)
     }
 
   /* calculate start pos */
-
-  if (orientation == GTK_ORIENTATION_HORIZONTAL)
+  if (!inverted)
     {
-      if (!inverted)
-        {
-          priv->activity_pos = 0.0;
-          priv->activity_dir = 0;
-        }
-      else
-        {
-          priv->activity_pos = 1.0;
-          priv->activity_dir = 1;
-        }
+      priv->activity_pos = 0.0;
+      priv->activity_dir = 0;
     }
   else
     {
-      if (!inverted)
-        {
-          priv->activity_pos = 0.0;
-          priv->activity_dir = 0;
-        }
-      else
-        {
-          priv->activity_pos = 1.0;
-          priv->activity_dir = 1;
-        }
+      priv->activity_pos = 1.0;
+      priv->activity_dir = 1;
     }
 
   update_node_classes (pbar);